{% extends "messages/base.html" %}
{% from "messages/includes/macros.html" import outbox_message, inbox_message with context %}
{% set title = _('Delete Message') %}
{% set crumbs = [(url('messages.inbox'), _('Messages'))] %}
{% if msgtype == 'inbox' %}
  {% set render_message = inbox_message %}
{% else %}
  {% set crumbs = crumbs + [(url('messages.outbox'), _('Sent Messages'))] %}
  {% set render_message = outbox_message %}
{% endif %}
{% set crumbs = crumbs + [(None, title)] %}

{% block content %}
  <div class="grid_9">
    <article id="delete-message" class="main message-view">
      {% if msgs|length > 1 %}
        <h1>{{ _('Are you sure you want to delete these messages?') }}</h1>
      {% else %}
        <h1>{{ _('Are you sure you want to delete this message?') }}</h1>
      {% endif %}
      <form action="" method="POST">
        {% for message in msgs %}
          <input type="hidden" name="id" value="{{ message.id }}" />
          {{ render_message(message) }}
        {% endfor %}
        {% csrf_token %}
        <input type="hidden" name="confirmed" value="1" />
        <button type="submit" class="btn" name="delete">{{ _('Delete') }}</button>
        <a href="{{ url('messages.{t}'.format(t=msgtype)) }}">{{ _('Cancel') }}</a>
      </form>
    </article>
  </div>
{% endblock %}
